"""
列表推导式
集合推导式
"""
a = [1, 2, 3, 4, 5, 6, 7, 8]

# b = [i * i for i in a]
# 新集合用老老集合每项的平方
b = [i ** 2 for i in a]

# 只有大于5的元素才做平方
# b = [i ** 2 for i in a if i >= 5]

# 设置结果为集合
b = {i ** 2 for i in a if i >= 5}
print(b)
